import Vue from 'vue'
import Router from 'vue-router'
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '*',
      redirect: '/book'
    },
    {
      path: '/loading',
      name: 'landing-page',
      component: require('@/components/LandingPage').default
    },
    {
      path: '/book',
      name: '读书',
      component: require('@/views/book/book.vue').default
    },
    {
      path: '/bookdetail',
      name: '读书详情',
      component: require('@/views/book/detail.vue').default
    }
  ]
})
